using System.IO;
using QuickTest.Core.Compilation;

namespace QuickTest.Services.TextRetrieval
{
    /// <summary>
    /// Retrieves text from a file
    /// </summary>
    public class FileTextRetriever : ITextRetriever
    {
        #region Construction

        public FileTextRetriever(FileUri fileUri)
        {
            FileUri = fileUri;
        }

        #endregion

        #region Properties

        private FileUri FileUri { get; set; }

        #endregion

        #region Methods

        public string GetText()
        {
            return File.ReadAllText(FileUri.AbsolutePath);
        }

        #endregion
    }
}